package com.seteam.collabcrossword.workers;

import com.seteam.collabcrossword.CommunicationChannel;
import com.seteam.collabcrossword.TileFactory;
import com.seteam.collabcrossword.exceptions.TileException;
import com.seteam.collabcrossword.messages.generic.UpdateLetter;
import org.junit.Test;

import java.net.Socket;

public class CommunicationChannelBehavior {
    @Test
    public void addingAMessageToOutgoingListCallsSendMethod() throws TileException {
        final CommunicationChannel communicationChannel = new CommunicationChannel(new Socket());
        communicationChannel.addToIncomingQueue(new UpdateLetter(TileFactory.createEmptyTile()));
        communicationChannel.addToOutgoingQueue(new UpdateLetter(TileFactory.createEmptyTile()));
        communicationChannel.addToOutgoingQueue(new UpdateLetter(TileFactory.createEmptyTile()));
        communicationChannel.addToIncomingQueue(new UpdateLetter(TileFactory.createEmptyTile()));
    }
}
